/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.webhomesites.padrao.utils;

import br.com.webhomesites.padrao.contracts.IDocument;
import javax.swing.text.PlainDocument;

/**
 *
 * @author Webhome
 */
public class StrategyDocument {
    
    public static class DocLetras implements IDocument {

            PlainDocument doc;

            @Override
            public PlainDocument getDocumentoPlano() {
                if (doc == null) {
                    doc = new PlainDocument();
                }
                doc.setDocumentFilter(DocumentFilterFactory.criar(DocumentFilterFactory.SO_LETRAS));
                return doc;
            }
        }
    
    public static class DocNumeros implements IDocument {

        PlainDocument doc;

        public DocNumeros() {
            super();
        }

        @Override
        public PlainDocument getDocumentoPlano() {
            if (doc == null) {
                doc = new PlainDocument();
            }
            doc.setDocumentFilter(DocumentFilterFactory.criar(DocumentFilterFactory.SO_NUMEROS));
            return doc;
        }
        
    }
    
    public static class DocEndereco implements IDocument {

        PlainDocument doc;

        public DocEndereco() {
            super();
        }

        @Override
        public PlainDocument getDocumentoPlano() {
            if (doc == null) {
                doc = new PlainDocument();
            }
            doc.setDocumentFilter(DocumentFilterFactory.criar(DocumentFilterFactory.ENDERECO));
            return doc;
        }
        
    }
    
    public static class DocNovo implements IDocument {

        PlainDocument doc;
        String er;

        public DocNovo(String pEr) {
            this.er = pEr;
        }

        @Override
        public PlainDocument getDocumentoPlano() {
            if (doc == null) {
                doc = new PlainDocument();
            }
            doc.setDocumentFilter(DocumentFilterFactory.criar(er));
            return doc;
        }
    }
   
}



